<?php

namespace Core\Converter;

class IdToObjectConverter implements IConverter {

    private $dao;

    public function accepts($string) {
        return ctype_digit($string);
    }

    public function convert($string) {
        $id = intval($string);
        return $this->dao->load($id);
    }

    public function setDao($dao) {
        $this->dao = $dao;
    }

}